#ifndef BIGDECIMAL_UBIGNUMBER_H
#define BIGDECIMAL_UBIGNUMBER_H
struct Node
{
    int digit;
    struct Node * next, * prev;
};

struct UBigNumber
{
    int digitCount;
    struct Node * pHead, * pTail;
};

struct UBigNumber InputUBN(char * s);
void PrintUBN(struct UBigNumber ubn);
struct UBigNumber AddUBN(struct UBigNumber * pA, struct UBigNumber * pB);
struct UBigNumber SubUBN(struct UBigNumber * pA, struct UBigNumber * pB);
struct UBigNumber MultiplyUBN(struct UBigNumber * pA, struct UBigNumber * pB);
void DestroyUBN(struct UBigNumber * pUBN);

// 辅助处理函数
void _InitUBN(struct UBigNumber * pUBN);
void _AppendDigit(struct UBigNumber * pUBN, int digit);
void _AppendFrontDigit(struct UBigNumber * pUBN, int digit);
void _Normalize(struct UBigNumber *pUBN);
struct Node * _NewNode();
struct UBigNumber _MultiplyDigit(struct UBigNumber * pA, int digit);
struct UBigNumber _FetchSub(struct UBigNumber * pA, int start, int end);

#endif //BIGDECIMAL_UBIGNUMBER_H